package com.huluobo.a2203parkdemo.adapter

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.huluobo.a2203parkdemo.R
import com.huluobo.base.bean.NewsBeanItem
import java.text.SimpleDateFormat
import java.util.Date

/**
 *  Created by LC on 2024/7/29.
 */
class NewsAdapter : BaseQuickAdapter<NewsBeanItem, BaseViewHolder>(R.layout.item_news) {
    override fun convert(helper: BaseViewHolder, item: NewsBeanItem) {
        helper.setText(R.id.news_title_tv, item.newsTitle)
        helper.setText(R.id.news_desc_tv, item.newsValue)
        val time = System.currentTimeMillis()
        val format = SimpleDateFormat("yyyy-MM-dd HH:mm:ss")
        val date = Date(time)
        helper.setText(R.id.new_time_tv, format.format(date))
    }
}